import 'package:app/util/http.dart';
import 'package:flutter/material.dart';


class StationUpdatesApi{

  BuildContext? context;

  static StationUpdatesApi of(BuildContext? context) {
    StationUpdatesApi stationUpdatesApi = StationUpdatesApi();
    stationUpdatesApi.context = context;
    return stationUpdatesApi;
  }



  /// 根据站点码，查询站点物料清单
  Future<dynamic> getStationItem(station) async{
    return ApiService.of(context).get('lgs/stationUpdates/searchStationMaterial/'+station);
  }

  /// 根据托盘号，查询托盘物料清单
  Future<dynamic> getContainerItem(container) async{
    return ApiService.of(context).get('lgs/stationUpdates/searchContainerMaterial/'+container);
  }

  /// 根据站点码、托盘号，查询托盘物料清单
  Future<dynamic> getItem(station,container) async{
    return await ApiService.of(context).get('lgs/stationUpdates/searchMaterial/'+station+'/'+container);
  }

  /// 根据站点码、清空站点绑定的托盘及物料
  Future<dynamic> clearStation(station) async{
    return await ApiService.of(context).get('lgs/stationUpdates/clearStation/'+station+'/');
  }

  /// 根据站点码、托盘号，查询托盘物料清单
  Future<dynamic> clearContainer(container) async{
    return await ApiService.of(context).get('lgs/stationUpdates/clearContainer/'+container);
  }

  /// 根据站点码、托盘号，查询托盘物料清单
  Future<dynamic> updateStationContainer(data) async{
    return await ApiService.of(context).put('lgs/stationUpdates/updateStationContainer',data);
  }


}